<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue-绑定</title>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
</head>
<body>
<h1>为什么是绿色</h1>
<div id="app">
    <div class="static" v-bind:class="{'active':isActive,'text-danger': hasError}"></div>
</div>
</body>
<style>
    .active {
        width: 100px;
        height: 100px;
        background: red;
    }
    .text-danger {
        background: green;
    }
</style>
<script>
    new Vue({
        el: '#app',
        data: {
            isActive: true,
            hasError: true
        }
    })
</script>
</html>